home *** CD-ROM | disk | FTP | other *** search
/ Creative Computers / Creative Computers CD-ROM, Volume 1 (Legendary Design Technologies, Inc.)(1994).iso / commercial / visual_inspirations / mlm / rexx / ppageenvelope.rexx < prev    next >
OS/2 REXX Batch file  |  1994-11-17  |  3KB  |  105 lines

  1. /*
  2.                             PPageEnvelope.Rexx
  3.                            Written By J.L. White
  4.                         (C) 1993 Merlin's Software
  5.  
  6.            For Use With Mailing List Manager & Professional Page
  7.                        Print Envelopes From Database
  8. */
  9.  
  10. Font = "Times" 
  11. FontSize = 15  
  12. CR = '0a'x
  13. arg Total
  14.  
  15. call SetUp
  16. call ppm_PPageToFront()
  17. call MakePages
  18. call PickPrint
  19. call ppm_PPageToBack()
  20. call ppm_New()
  21. exit
  22.  
  23. SetUp:
  24.     FileName = "RAM:MLM.Temp"
  25.     ReturnName = "RAM:MLM.Return"
  26.     CustomPage = "MLM:Rexx/CustomEnvelope.PPage"
  27.     BlankPage = "MLM:Rexx/BlankEnvelope.PPage"
  28.     call ppm_New()
  29.     call ppm_SetFont(Font)
  30.     call ppm_SetStyle(B)
  31.     call ppm_SetJustification(0)
  32.     call ppm_SetSize(FontSize)
  33.     TypeEnvelope = ppm_Inform(2,"Custom Or Generic?","GENERIC","CUSTOM")
  34.     if TypeEnvelope = 1 then
  35.         ppm_LoadDocument(CustomPage,1,0)
  36.     else do
  37.         ppm_LoadDocument(BlankPage,1,0)
  38.         ppm_ImportText(1,ReturnName)
  39.         end
  40. return
  41.  
  42.  
  43. MakePages:
  44.     TotalPages = Total
  45.     BoxA = Box1
  46.     do i = 2 to TotalPages
  47.         ppm_CopyPage(1,Total+1,1)
  48.     end
  49.     ppm_GotoPage(1)
  50.     Box1 = ppm_CreateBox(3.7173,1.7500,4.4267,1.4667,0)
  51.     BoxA = Box1
  52.     do i = 2 to TotalPages
  53.         ppm_GotoPage(i)
  54.         BoxB = ppm_CreateBox(3.7173,1.7500,4.4267,1.4667,0)
  55.         ppm_LinkBox(BoxA,BoxB)
  56.         BoxA = BoxB
  57.     end
  58.     ppm_GotoPage(1)
  59.     ppm_SelectBox(Box1)
  60.     ppm_ImportText(Box1,FileName)
  61. return
  62.  
  63. PickPrint:
  64.     TypePrint=ppm_Inform(2,"Postscript Or Preference Printer","PREFERENCE PRINTER","POSTSCRIPT")
  65.     if TypePrint = 1 then call PostPrint
  66.     if TypePrint = 0 then call PrefPrint
  67. return
  68.  
  69. PostPrint:
  70.     OutPut = ppm_Inform(3,"Select Type Of Output To Use?","DISK","SER:","PAR:");
  71.     if OutPut = 2 then TypeOutPut = "PAR:"
  72.     if OutPut = 1 then TypeOutPut = "SER:"
  73.     if OutPut = 0 then do
  74.         TypeOutPut = ppm_GetUserText(50,"Enter Name For Output File!")
  75.         if TypeOutPut = "" then call NoPrint
  76.         end
  77.     call ppm_SetPSOutput(TypeOutPut)
  78.     Manual = ppm_Inform(2,"Manual Feed ON-OFF?","OFF","ON")
  79.     call ppm_SetPSManFeed(Manual)
  80.     NumCopy =  ppm_GetUserText(3,"Enter # Of Copies To Print!")
  81.     if NumCopy < 1 then call NoPrint
  82.     if NumCopy > 0 then ppm_PrintDocPS(NumCopy,1)
  83. return
  84.  
  85.  
  86. PrefPrint:
  87.     Eject=ppm_Inform(2,"Eject Page ON-OFF?","OFF","ON")
  88.     call ppm_SetDMEject(Eject)
  89.     Text = "4"cr"1"cr"2"cr"3"cr"5"cr"6"cr"7"
  90.     Density = value(ppm_SelectFromList(" Select Density",1,7,0,Text))
  91.     if Density < 1 then call NoPrint
  92.     call ppm_SetDMDensity(Density)
  93.     NumCopy =  ppm_GetUserText(3,"Enter # Of Copies To Print!")
  94.     if NumCopy < 1 then call NoPrint
  95.     call ppm_PrintDocDM(NumCopy,1)
  96. return
  97.  
  98. NoPrint:
  99.     ppm_Inform(1,"Printing Has Been Cancelled!","OK")
  100.     call ppm_PPageToBack()
  101.     call ppm_New()
  102.     exit
  103. return
  104.  
  105.